<template>
  <div class="wrap">
    我的泳票h5
    <div @click="goBack">回到小程序</div>
    <van-button type="primary">主要按钮</van-button>
  </div>
</template>

<script setup>
import { reactive, ref, onMounted, onLaunch, watch, computed } from 'vue'
import { useRouter, useRoute } from 'vue-router'
import { postData } from '@/request/request.js'
let router = useRouter()
let route = useRoute()

let datas = ref([])
let query = route.query
localStorage.setItem('user_id', query.user_id)
localStorage.setItem('access_token', query.access_token)
localStorage.setItem('open_id', query.open_id)
localStorage.setItem('currentPath', query.currentPath)

let getList = () => {
  postData('/user/ticket/list', {})
    .then((res) => {
      console.log(res)
    })
    .catch((err) => {
      console.log(err)
    })
}


let goBack = () => {
  uni.switchTab({
   url: '/pages/home/index/index',
  })
 
  // uni.webView.postMessage({
  //   data: {
  //     action: 'token失效了', //可自己随意定义，需要与app中接收通信的方法对应
  //   },
  // })

}

onMounted(() => {
  getList()
})


</script>

<style scoped></style>
